package com.aidex.biz.service.impl;

import java.util.List;

import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.ShareLogMapper;
import com.aidex.biz.domain.ShareLog;
import com.aidex.biz.service.ShareLogService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 分配记录Service业务层处理
 *
 * @author sean
 * @email 2074844820@qq.com
 * @date 2023-04-03
 */
@Service
@Transactional(readOnly = true)
public class ShareLogServiceImpl extends BaseServiceImpl<ShareLogMapper, ShareLog> implements ShareLogService {
    private static final Logger log = LoggerFactory.getLogger(ShareLogServiceImpl.class);

    /**
     * 获取单条数据
     *
     * @param shareLog 分配记录
     * @return 分配记录
     */
    @Override
    public ShareLog get(ShareLog shareLog) {
        ShareLog dto = super.get(shareLog);
        return dto;
    }

    /**
     * 获取单条数据
     *
     * @param id 分配记录id
     * @return 分配记录
     */
    @Override
    public ShareLog get(String id) {
        ShareLog dto = super.get(id);
        return dto;
    }


    /**
     * 查询分配记录列表
     *
     * @param shareLog 分配记录
     * @return 分配记录
     */
    @Override
    @DataScope(userAlias = "a", deptAlias = "a")
    public List<ShareLog> findList(ShareLog shareLog) {
        return super.findList(shareLog);
    }

    /**
     * 分页查询分配记录列表
     *
     * @param shareLog 分配记录
     * @return 分配记录
     */
    @Override
    @DataScope(userAlias = "a", deptAlias = "a")
    public PageInfo<ShareLog> findPage(ShareLog shareLog) {
        return super.findPage(shareLog);
    }

    /**
     * 保存分配记录
     *
     * @param shareLog
     * @return 结果
     */
    @Override
    public boolean save(ShareLog shareLog) {
        return super.save(shareLog);
    }


    /**
     * 删除分配记录信息
     *
     * @param shareLog
     * @return 结果
     */
    @Override
    public boolean remove(ShareLog shareLog) {
        return super.remove(shareLog);
    }

    /**
     * 批量删除分配记录
     *
     * @param ids 需要删除的分配记录ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteShareLogByIds(String[] ids) {
        return mapper.deleteShareLogByIds(ids);
    }

    /**
     * 获取最大编号
     *
     * @param shareLog 分配记录
     * @return 结果
     */
    @Override
    public int findMaxSort(ShareLog shareLog) {
        return NumberUtils.nextOrder(mapper.findMaxSort(shareLog));
    }

    /**
     * 查找第一个
     *
     * @param shareLog
     * @return
     */
    @Override
    public ShareLog findOne(ShareLog shareLog) {
        return mapper.findOne(shareLog);
    }
}
